package com.jackrain.clouddata.sys.controller;
/**
 * Created by tangzhipeng on 2017/8/9
 */

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.jackrain.nea.web.query.QueryEngine;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * 获取执行时间表的配置
 */
@RestController
@Slf4j
public class ExecuteTimeController {
    @RequestMapping(path = "/p/cs/queryExecuteTime", method = RequestMethod.GET)
    public JSONObject queryExecuteTime(HttpServletRequest request) {
        JSONObject jo = new JSONObject();
        JSONArray executeTimeJo = QueryEngine.getInstance().doQueryObjectArray("select OMSTAGID,OMS_TOPICID," +
                "STARTTIME,EXESTEPTIME,LAYTIME,LASTTIME from OMS_TOPICTIME");
        log.info("---------------------" + executeTimeJo + "----------------------");
        jo.put("code", 0);
        jo.put("message", null);
        jo.put("data", executeTimeJo);
        return jo;
    }
}
